<?php

class HotelController extends Controller {

    public function actionAbout() {
        try {
            $hotel = $_GET['id'];
            $content_conditions = new EMongoCriteria;
            $content_conditions->hotel = $hotel;
            $content = Content::model()->find($content_conditions);
            $item_condition = new EMongoCriteria;
            $item_condition->hotel = $hotel;
            $item_condition->page = 'homeslide';
            $item_condition->order = '1';
            $item = Item::model()->find($item_condition);
            $lang = Yii::app()->session['_lang'];
            if ($content) {
                $hotel_condition = new EMongoCriteria;
                $hotel_condition->name = $hotel;
                $Hotel = Hotel::model()->find($hotel_condition);
                return $this->render('detail', array(
                            'content' => $content->hotelDescription[$lang],
                            'item' => $item,
                            'hotel' => $hotel,
                            'currentHotel' => $Hotel,
                            'lang' => $lang));
            } else {
                echo 'Khach san nay khong ton tai!';
            }
        } catch (Exception $e) {
            echo $e;
            die;
        }
    }

}

?>
